home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / rukq121s.zip / ruckdac.bi < prev    next >
Text File  |  1996-07-30  |  10KB  |  227 lines

  1. 'RUCKDAC.BI 1.2 for BASIC7/VB-DOS
  2. 'changes since 1.11:
  3. 'SysInfoPack extended to 6 devices
  4. '.BI7 and .BI combined into this single .BI (SysInfoPackTYPE7 at end, optional)
  5. '--
  6. ' Everything is the same, except that the SB16 device has been added for
  7. ' VOC/WAV/Mod playback (8-bit).  It is not available for recording; use the
  8. ' SBpro, if possible.  Other changes is that the LoadDac XMS I/O is now 8K,
  9. ' down from 16K.  The main reason for adding the SB16 is that it is not
  10. ' 100% backward compatible with the SBpro (you can't get stereo out of an
  11. ' SB16, for one).  The mixer is mostly compatible, so use the SBpro mixer
  12. ' for controlling the SB16.
  13.  
  14. DECLARE FUNCTION RUCKDAC% (SEG packinfo AS ANY)
  15.  
  16. CONST SysInfoDac = 0, InitDac = 1, ExitDac = 2, AtExitDac = 3
  17. CONST LoadDac = 4, PlayDac = 5, RecordDac = 6
  18. CONST StoreDac = 7, EndDac = 8, PauseDac = 9
  19. CONST DeallocDac = 10
  20.  
  21. CONST SetAllDac = 20, SetVolumeDac = 21, SetIntRateDac = 22, SetPriorityDac = 23
  22. CONST GetBufferDataDac = 28, GetBytePosDac = 29
  23.  
  24. CONST SetAllSBP = 30, SetVolMainSBP = 31, SetVolVocSBP = 32
  25. CONST SetLevelMicSBP = 33, SetLevelCDSBP = 34, SetLevelLineSBP = 35
  26. CONST SetFilterOutSBP = 36, SetFilterInSBP = 37
  27. CONST SetSourceSBP = 38, SetStereoSBP = 39
  28.  
  29. CONST SetSpeakerSB = 40
  30. CONST GetMixerRegSBP = 48, GetDacSB = 49
  31.  
  32. CONST ExitMod = 50, AtExitMod = 51
  33. CONST LoadMod = 52, PlayMod = 53
  34. CONST EndMod = 54, PauseMod = 55
  35. CONST SetIntRateMod = 56, SetSpeedMod = 57
  36. CONST SetVolumeMod = 58, SetPositionMod = 59
  37. CONST SetStereoMod = 60, SetFastMod = 61
  38.  
  39. TYPE DeallocPackTYPE            'DP
  40.  Func       AS INTEGER
  41.  stat       AS INTEGER
  42.  HandSeg    AS INTEGER          'RUCKUS allocates either XMM handle or DOS para
  43.  TypeFlag   AS INTEGER          '0=DOS para, 1=XMS handle
  44. END TYPE '8
  45.  
  46. TYPE GetDataPackTYPE            'GDP
  47.  Func       AS INTEGER
  48.  stat       AS INTEGER
  49.  BytePos    AS LONG             'current byte relative base ptr (27)
  50.  BufferPtrOff AS INTEGER        'far pointer to buffer to fill with data,offset
  51.  BufferPtrSeg AS INTEGER        'segment
  52.  StartPos   AS LONG             'start get at this offset relative BufferPtr
  53.  BufferCnt  AS INTEGER          'bytes to fill (2-65520)
  54.  MixerReg   AS INTEGER          'SBPro mixer register to get
  55. END TYPE '20
  56.  
  57. TYPE InitPackTYPE               'IP
  58.  Func       AS INTEGER
  59.  stat       AS INTEGER
  60.  DeviceID   AS INTEGER          '0=SPKR,1=LPTDAC,2=DSS,4=SB,5=SBPro
  61.  IOport     AS INTEGER
  62.  IRQline    AS INTEGER
  63.  DMAch      AS INTEGER
  64.  Flags      AS INTEGER          '(see source)
  65.  InfoPtrOff AS INTEGER          'ret:far ptr to dac info
  66.  InfoPtrSeg AS INTEGER
  67.  DacExitPtrOff AS INTEGER       'ret:far ptr to dac's ExitXB routine
  68.  DacExitPtrSeg AS INTEGER
  69.  ModExitPtrOff AS INTEGER       'ret:far ptr to mod's ExitXB routine
  70.  ModExitPtrSeg AS INTEGER
  71. END TYPE '24
  72.  
  73. TYPE LoadPackTYPE               'LP
  74.  Func       AS INTEGER
  75.  stat       AS INTEGER
  76.  FilenamePtrOff AS INTEGER      'far ptr to filenameZ to load
  77.  FilenamePtrSeg AS INTEGER
  78.  StartPos   AS LONG             'offset into file to start load at
  79.  LoadSize   AS LONG             'number of bytes to load (or 0 for autosize)
  80.  XMMflag    AS INTEGER          'if <> 0 use XMS for load
  81.  XMMhandle  AS INTEGER          'ret:XMS handle, or
  82.  LoadPtrOff AS INTEGER          'ret:DOS seg:offset (offset always 0)
  83.  LoadPtrSeg AS INTEGER
  84. END TYPE '20
  85.  
  86. TYPE PlaybackPackTYPE           'PBP
  87.  Func       AS INTEGER
  88.  stat       AS INTEGER
  89.  Mode       AS INTEGER          'playback mode (0=interrupt FG,1=BG,2=DMA,3=DMA+BG for mod)
  90.  XMMhandle  AS INTEGER          'if <> 0 this XMM handle used regardless
  91.  LoadPtrOff AS INTEGER          'seg:off to start of data to play
  92.  LoadPtrSeg AS INTEGER
  93.  BufferSize AS INTEGER          'size of DMA buffer for mod playback
  94. END TYPE '14
  95.  
  96. TYPE PausePackTYPE              'PP
  97.  Func       AS INTEGER
  98.  stat       AS INTEGER
  99.  Pause      AS INTEGER          '0=unpause else pause
  100. END TYPE '6
  101.  
  102. TYPE RecordPackTYPE             'RP
  103.  Func         AS INTEGER
  104.  stat         AS INTEGER
  105.  SampleRate   AS INTEGER
  106.  XMMhandle    AS INTEGER        '-1 auto XMS (ret in dx) else use this handle
  107.  RecordPtrOff AS INTEGER        'seg:off of buffer to store (0 for auto-store)
  108.  RecordPtrSeg AS INTEGER
  109.  RecordBytes  AS LONG           'bytes to record
  110.  StereoFlag   AS INTEGER        'stereo flag
  111. END TYPE '18
  112.  
  113. TYPE SaveDataPackTYPE           'SDP
  114.  Func       AS INTEGER
  115.  stat       AS INTEGER
  116.  FilenamePtrOff AS INTEGER      'far ptr to filenameZ to save
  117.  FilenamePtrSeg AS INTEGER
  118.  DataPtrOff AS INTEGER          'pointer to start of data to save, offset
  119.  DataPtrSeg AS INTEGER          'segment (or 0 if XMS)
  120.  FileType   AS INTEGER          '1=VOC,2=WAV
  121.  XMMhandle  AS INTEGER          'XMS handle of data to save (0 if DOS data)
  122. END TYPE '16
  123.  
  124. TYPE SetPackTYPE                'SP
  125.  Func       AS INTEGER
  126.  stat       AS INTEGER          ' (if volume=0 SB speaker off'ed else on'ed)
  127.  Volume     AS INTEGER          'volume (left ch=MSB,right=LSB) (0-127,0-127)
  128.  IntRate    AS INTEGER          'playback interrupt rate (5000-23000)
  129.  Priority   AS INTEGER          'priority level (0-2, default=1)
  130. END TYPE '18
  131.  
  132. TYPE SetModPackTYPE             'SMP                    'stereo modes
  133.  Func       AS INTEGER                                  'A=ch1+ch3 & ch2+ch4
  134.  stat       AS INTEGER                                  'B=?
  135.  VolCh1     AS INTEGER          'channel volume (0-255) 'C=?
  136.  VolCh2     AS INTEGER          'channel volumes adjustments made only
  137.  VolCh3     AS INTEGER          ' if FastMode=0
  138.  VolCh4     AS INTEGER
  139.  Stereo     AS INTEGER          'playback mode (0=mono,stereo 1=A,2=B,3=C)
  140.  FastMode   AS INTEGER          'fast playback (0=normal,1 fast,no ch volumes)
  141.  IntRate    AS INTEGER          'playback interrupt rate (5000-45500)
  142.  Position   AS INTEGER          'pattern list position (0-patterns to play)
  143.  Speed      AS INTEGER          'overall playback speed (1-15,default=6,15=slow)
  144.  SliceAdj   AS INTEGER          'slice adjust (1-64,default=1)
  145. END TYPE '24
  146.  
  147. TYPE SetProPackTYPE             'SPP
  148.  Func       AS INTEGER
  149.  stat       AS INTEGER
  150.  Volume     AS INTEGER          'volume (low=right;0-15, high byte=left;0-15)
  151.  VolVoc     AS INTEGER          '
  152.  VolMic     AS INTEGER          '(mono only, 0-7) input level
  153.  VolCD      AS INTEGER          'input level (0-15,0-15)
  154.  VolLI      AS INTEGER          'input level (0-15,0-15)
  155.  FilterOut  AS INTEGER          '0=filter off, 1=filter on
  156.  FilterIn   AS INTEGER          '0=filter off, 1=3.2kHz, 2=8.8kHz
  157.  SourceIn   AS INTEGER          '0=mic,1=CD,2=line
  158.  StereoIn   AS INTEGER          '0=mono,1=stereo record
  159. END TYPE '22
  160.  
  161. TYPE XitPackTYPE                'XP
  162.  Func       AS INTEGER
  163.  stat       AS INTEGER
  164. END TYPE '4
  165.  
  166. TYPE SysInfoPackTYPE            'SIP
  167.  Func       AS INTEGER          '
  168.  stat       AS INTEGER
  169.  CPU        AS INTEGER          'CPU class (88,286,386,486)
  170.  CPUmode    AS INTEGER          '0=real mode,1=PM,2=PM w/paging
  171.  MHz        AS INTEGER          'approx speed (5,20,33)
  172.  Device0    AS INTEGER          '=1 speaker available
  173.  D0port     AS INTEGER          '42h
  174.  D0IRQ      AS INTEGER          'n/a
  175.  D0DMA      AS INTEGER          'n/a
  176.  D0flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  177.  Device1    AS INTEGER          '=1 LPT-DAC available on LPT1
  178.  D1port     AS INTEGER          'port of _first_ LPT found in BIOS data area
  179.  D1IRQ      AS INTEGER          'n/a
  180.  D1DMA      AS INTEGER          'n/a
  181.  D1flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  182.  Device2    AS INTEGER          '=1 Disney Sound Source available
  183.  D2port     AS INTEGER          'port of DSS
  184.  D2IRQ      AS INTEGER          'n/a
  185.  D2DMA      AS INTEGER          'n/a
  186.  D2flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  187.  Device3    AS INTEGER          '=1 AdLib available
  188.  D3port     AS INTEGER          '388h
  189.  D3IRQ      AS INTEGER          'n/a
  190.  D3DMA      AS INTEGER          'n/a
  191.  D3flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  192.  Device4    AS INTEGER          '=1 SB available
  193.  D4port     AS INTEGER          'port of SB
  194.  D4IRQ      AS INTEGER          'IRQ
  195.  D4DMA      AS INTEGER          'DMA
  196.  D4flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  197.  Device5    AS INTEGER          '=1 SBPro available
  198.  D5port     AS INTEGER          'port of SBPro
  199.  D5IRQ      AS INTEGER          'IRQ
  200.  D5DMA      AS INTEGER          'DMA
  201.  D5flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  202.  Device6    AS INTEGER          '=1 SB16 available
  203.  D6port     AS INTEGER          'port of SB16
  204.  D6IRQ      AS INTEGER          'IRQ
  205.  D6DMA      AS INTEGER          'DMA
  206.  D6flags    AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  207. END TYPE '80
  208.  
  209. TYPE SysDevTYPE                 'SD (used by BASIC 7.1 compiler)
  210.  device     AS INTEGER          '=1 device available
  211.  port       AS INTEGER
  212.  IRQ        AS INTEGER
  213.  DMA        AS INTEGER
  214.  Flags      AS INTEGER          'bit4=MIDI/3=XMS/2=DMA/1=REC/0=PLAY
  215. END TYPE '10
  216.  
  217. TYPE SysInfoPackTYPE7           'SIP   BASIC 7.1: SIP.SD(0).device = ...
  218.  Func       AS INTEGER
  219.  stat       AS INTEGER
  220.  CPU        AS INTEGER          'CPU class (88,286,386,486)
  221.  CPUmode    AS INTEGER          '0=real mode,1=PM,2=PM w/paging
  222.  MHz        AS INTEGER          'approx speed (5,20,33)
  223.  SD(0 TO 6) AS SysDevTYPE       'QB45 won't accept arrays in TYPEs
  224. END TYPE '80
  225.  
  226. 'END RUCKDAC.BI -----------------------
  227.